#include <iostream>
using std::cout;
using std::endl;
template <class T>
class beta
{
private:
    template <class V>
    class hold
    {
        private:
            V val;
        public:
            hold(V v=0):val(v) {}
            void show() const { cout << val <<endl;}
            V value() const {return val;}
    };
    hold<T> q;
    hold<int> n;
public:
    beta(T t,int i):q(t),n(i){}
    template<class U>
    U blab(U u,T t){ return (n.value()+q.value())*u / t; }
    void show() const {q.show();n.show();}
};

int main(int argc, char const *argv[])
{
    beta<double> guy(3.5,3);
    cout <<"T was set to double\n";
    guy.show();

    cout <<guy.blab(10,2.3) << endl;

    cout <<guy.blab(10.0,2.3) << endl;

    cout <<"(1.2+3)*3/5=" << (int)(1.2+3)*3/5<<endl;
    cout <<"(1.2+3)*3/5=" << (double)(1.2+3)*3/5<<endl;

    cout <<"(1.2+3)*3.0/5=" <<(int) ((1.2+3)* 3.0/5)<<endl;
    cout <<"(1.2+3)*3.0/5=" <<(double) (1.2+3)* 3.0/5<<endl;
    return 0;
}
